<template>
	<view class="content">
		<icon class="icon-box-img" type="success" size="93"></icon>
		<view class="icon-box-ctn">
			<view class="icon-box-title">提交成功</view>
			<view class="icon-box-desc">外办已收到您的求助，将尽快为您处理，请您注意关注平台消息并保持电话畅通，{{date}}s后跳转至首页。</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				date: 5,
				time: null
			}
		},
		onUnload() {
			clearInterval(this.time);
		},
		onLoad() {
			this.time = setInterval(() => {
				if(this.date <= 0) {
					uni.switchTab({
						url: '/pages/index/index'
					});
					clearInterval(this.time);
				} else {
					this.date = this.date - 1;
				}
			}, 1000)
		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scope>
page {
	height: 100%;
	width: 100%;
	
	.content {
		height: 80%;
		width: 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		
		.icon-box-ctn {
			width: 60%;
			text-align: center;
			
			.icon-box-title {
				font-size: 20px;
				margin-top: 15px;
				color: $u-success;
			}
			
			.icon-box-desc {
				font-size: 15px;
				margin-top: 15px;
				color: #909193;
			}
		}
	}
}
</style>
